package com.yequan.hbb.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by DingLong on 2016/10/23.
 */

public class TuanFragmentAdapter extends FragmentPagerAdapter {
    private String[] title;
    private List<Fragment> list;

    public TuanFragmentAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        title = new String[]{"全部拼团", "闪电拼团", "定时拼团", "烘焙原料", "烘焙用具", "烘焙包装", "烘焙商品"};
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
